package com.kk.travel.dao.impl;

import java.util.List;

import com.kk.travel.admin.Word;
import com.kk.travel.dao.DAO;
import com.kk.travel.dao.WordDao;

public class WordDaoImpl extends DAO<Word>  implements WordDao{
	
	@Override
	public void insertWord(String email, String word,String time) {
		String sql="insert into kk_words(words,user_email,time) values(?,?,?)";
		update(sql,word,email,time);
	}

	@Override
	public List<Word> getAllWords() {
		String sql="select id,words,user_email userEmail,time,click_count clickCount from kk_words order by time desc";
		return getForList(sql);
	}

	@Override
	public void updateClickCount(Integer id,Integer count) {
		String sql="update kk_words set click_count=? where id=?";
		update(sql,count,id);
		
	}

}
